package com.day09;

import javax.swing.*;
import java.awt.*;

public class ScrollPanelFrame extends JFrame {
    private JScrollPane scrollPane;
    private JTextArea jta;

    public ScrollPanelFrame() {
        initComponent();
        addComponent();
        addListener();
        initWindows();
    }

    private static final int WINDOW_WIDTH = 640;
    private static final int WINDOW_HEIGHT = 640;

    private void initComponent() {
        jta = new JTextArea();
        jta.setLineWrap(true);
        scrollPane = new JScrollPane();
    }

    private void addComponent() {
        this.add(scrollPane);
    }

    private void addListener() {

    }

    private void initWindows() {
        this.setTitle("小游戏");
        this.setSize(WINDOW_WIDTH, WINDOW_HEIGHT);
        this.setLocationRelativeTo(null);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setVisible(true);
    }

    public static void main(String[] args) {
        new ScrollPanelFrame();
    }
}
